﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="display.aspx.cs" Inherits="UI.system.page.config.display" %>
<%@ Import Namespace="Model" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script src="/js/jquery.min.js"></script>
    <script src="/js/common.js"></script>
    <script src="/js/md5.js"></script>
    <script src="/js/swfupload.js"></script>
    <script src="/system/js/admin.js"></script>
    <script src="/system/layui/layui.js"></script>
    <link rel="stylesheet" href="/system/layui/css/layui.css">
    <link rel="stylesheet" href="/system/layui/css/global.css">
    <link rel="stylesheet" href="/system/css/iframe.css">
    <script type="text/javascript" src="/system/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" src="/system/ueditor/ueditor.all.min.js"> </script>
    <script type="text/javascript" src="/system/ueditor/lang/zh-cn/zh-cn.js"></script>
    <style>
        .name{margin-left:0px;}
        .layui-input{height:30px; line-height:30px;}
        .layui-table td, .layui-table th{padding:5px 5px}
        .layui-form-switch{margin-top:0px;}
        .title{ height:40px; font-size:24px; color:#4f8bed; font-weight:bold; float:left;}
    </style>
</head>
<body>
<div style="margin: 35px; margin-top:10px; padding-bottom:35px;">
<form class="layui-form" style="padding-left:0px;">
    <div class="title">首页导航菜单显示设置</div>
	<table class="layui-table">
      <colgroup>
        <col width="200">
        <col width="200">
        <col width="150">
        <col>
        <col width="130">
      </colgroup>
      <thead>
        <tr>
          <th>原始名称</th>
          <th>自定义名称</th>
          <th>显示顺序</th>
          <th></th>
          <th>是否显示在首页</th>
        </tr> 
      </thead>
      <tbody>
        <tr column="menu1">
          <td>公司介绍</td>
          <td><input type="text" value="<%=menu1[2] %>" class="layui-input name" onblur="Update_Menu(this)"/></td>
          <td><input type="text" value="<%=menu1[0] %>" class="layui-input sort" onblur="Update_Menu(this)"/></td>
          <td></td>
          <td><input type="checkbox" name="yyy" lay-skin="switch" lay-text="是|否" lay-filter="istop" class="istop" <%=menu1[1]=="1"?"checked":"" %>></td>
        </tr>
        <tr column="menu2">
          <td>产品中心</td>
          <td><input type="text" value="<%=menu2[2] %>" class="layui-input name" onblur="Update_Menu(this)"/></td>
          <td><input type="text" value="<%=menu2[0] %>" class="layui-input sort" onblur="Update_Menu(this)"/></td>
          <td></td>
          <td><input type="checkbox" name="yyy" lay-skin="switch" lay-text="是|否" lay-filter="istop" class="istop" <%=menu2[1]=="1"?"checked":"" %>></td>
        </tr>
        <tr column="menu3">
          <td>公司环境</td>
          <td><input type="text" value="<%=menu3[2] %>" class="layui-input name" onblur="Update_Menu(this)"/></td>
          <td><input type="text" value="<%=menu3[0] %>" class="layui-input sort" onblur="Update_Menu(this)"/></td>
          <td></td>
          <td><input type="checkbox" name="yyy" lay-skin="switch" lay-text="是|否" lay-filter="istop" class="istop" <%=menu3[1]=="1"?"checked":"" %>></td>
        </tr>
        <tr column="menu4">
          <td>资质荣誉</td>
          <td><input type="text" value="<%=menu4[2] %>" class="layui-input name" onblur="Update_Menu(this)"/></td>
          <td><input type="text" value="<%=menu4[0] %>" class="layui-input sort" onblur="Update_Menu(this)"/></td>
          <td></td>
          <td><input type="checkbox" name="yyy" lay-skin="switch" lay-text="是|否" lay-filter="istop" class="istop" <%=menu4[1]=="1"?"checked":"" %>></td>
        </tr>
        <tr column="menu5">
          <td>企业文化</td>
          <td><input type="text" value="<%=menu5[2] %>" class="layui-input name" onblur="Update_Menu(this)"/></td>
          <td><input type="text" value="<%=menu5[0] %>" class="layui-input sort" onblur="Update_Menu(this)"/></td>
          <td></td>
          <td><input type="checkbox" name="yyy" lay-skin="switch" lay-text="是|否" lay-filter="istop" class="istop" <%=menu5[1]=="1"?"checked":"" %>></td>
        </tr>
        <tr column="menu6">
          <td>联系我们</td>
          <td><input type="text" value="<%=menu6[2] %>" class="layui-input name" onblur="Update_Menu(this)"/></td>
          <td><input type="text" value="<%=menu6[0] %>" class="layui-input sort" onblur="Update_Menu(this)"/></td>
          <td></td>
          <td><input type="checkbox" name="yyy" lay-skin="switch" lay-text="是|否" lay-filter="istop" class="istop" <%=menu6[1]=="1"?"checked":"" %>></td>
        </tr>
        <tr column="menu7">
          <td>留言反馈</td>
          <td><input type="text" value="<%=menu7[2] %>" class="layui-input name" onblur="Update_Menu(this)"/></td>
          <td><input type="text" value="<%=menu7[0] %>" class="layui-input sort" onblur="Update_Menu(this)"/></td>
          <td></td>
          <td><input type="checkbox" name="yyy" lay-skin="switch" lay-text="是|否" lay-filter="istop" class="istop" <%=menu7[1]=="1"?"checked":"" %>></td>
        </tr>
        <tr column="menu8">
          <td>地理位置</td>
          <td><input type="text" value="<%=menu8[2] %>" class="layui-input name" onblur="Update_Menu(this)"/></td>
          <td><input type="text" value="<%=menu8[0] %>" class="layui-input sort" onblur="Update_Menu(this)"/></td>
          <td></td>
          <td><input type="checkbox" name="yyy" lay-skin="switch" lay-text="是|否" lay-filter="istop" class="istop" <%=menu8[1]=="1"?"checked":"" %>></td>
        </tr>
      </tbody>
    </table>
    <div class="title">首页模块显示设置</div>
    <table class="layui-table">
      <colgroup>
        <col width="200">
        <col width="200">
        <col width="150">
        <col width="80">
        <col>
        <col width="130">
      </colgroup>
      <thead>
        <tr>
          <th>原始名称</th>
          <th>自定义名称</th>
          <th>显示顺序</th>
          <th>显示条数</th>
          <th></th>
          <th>是否显示在首页</th>
        </tr> 
      </thead>
      <tbody>
        <tr column="notice">
          <td>最新资讯</td>
          <td><input type="text" value="<%=notice[4] %>" class="layui-input name" onblur="Update_Index(this)"/></td>
          <td><input type="text" value="<%=notice[0] %>" class="layui-input sort" onblur="Update_Index(this)"/></td>
          <td><input type="text" value="<%=notice[2] %>" class="layui-input count" onblur="Update_Index(this)"/></td>
          <td><font id="newstypeids" ids="<%=notice[3] %>"><%=string.Join(",",newstypelist.Select(x=>x.Name)) %></font>&nbsp; <a onclick="Select_NewsType()">选择数据来源</a></td>
          <td><input type="checkbox" name="yyy" lay-skin="switch" lay-text="是|否" lay-filter="istop2" class="istop" <%=notice[1]=="1"?"checked":"" %>></td>
        </tr>
        <tr column="intro">
          <td>公司介绍</td>
          <td><input type="text" value="<%=intro[2] %>" class="layui-input name" onblur="Update_Index(this)"/></td>
          <td><input type="text" value="<%=intro[0] %>" class="layui-input sort" onblur="Update_Index(this)"/></td>
          <td></td>
          <td></td>
          <td><input type="checkbox" name="yyy" lay-skin="switch" lay-text="是|否" lay-filter="istop2" class="istop" <%=intro[1]=="1"?"checked":"" %>></td>
        </tr>
        <tr column="cult">
          <td>企业文化</td>
          <td><input type="text" value="<%=cult[2] %>" class="layui-input name" onblur="Update_Index(this)"/></td>
          <td><input type="text" value="<%=cult[0] %>" class="layui-input sort" onblur="Update_Index(this)"/></td>
          <td></td>
          <td></td>
          <td><input type="checkbox" name="yyy" lay-skin="switch" lay-text="是|否" lay-filter="istop2" class="istop" <%=cult[1]=="1"?"checked":"" %>></td>
        </tr>
        <tr column="environment">
          <td>公司环境</td>
          <td><input type="text" value="<%=environment[3] %>" class="layui-input name" onblur="Update_Index(this)"/></td>
          <td><input type="text" value="<%=environment[0] %>" class="layui-input sort" onblur="Update_Index(this)"/></td>
          <td><input type="text" value="<%=environment[2] %>" class="layui-input count" onblur="Update_Index(this)"/></td>
          <td></td>
          <td><input type="checkbox" name="yyy" lay-skin="switch" lay-text="是|否" lay-filter="istop2" class="istop" <%=environment[1]=="1"?"checked":"" %>></td>
        </tr>
        <tr column="honor">
          <td>资质荣誉</td>
          <td><input type="text" value="<%=honor[3] %>" class="layui-input name" onblur="Update_Index(this)"/></td>
          <td><input type="text" value="<%=honor[0] %>" class="layui-input sort" onblur="Update_Index(this)"/></td>
          <td><input type="text" value="<%=honor[2] %>" class="layui-input count" onblur="Update_Index(this)"/></td>
          <td></td>
          <td><input type="checkbox" name="yyy" lay-skin="switch" lay-text="是|否" lay-filter="istop2" class="istop" <%=honor[1]=="1"?"checked":"" %>></td>
        </tr>
        <%foreach(TagsInfo tags in tagslist){ %>
        <tr column="tags" tagsid="<%=tags.ID %>">
          <td><%=tags.Name %></td>
          <td><input type="text" value="<%=tags.Name %>" class="layui-input name" onblur="Update_Index(this)"/></td>
          <td><input type="text" value="<%=tags.Sort %>" class="layui-input sort" onblur="Update_Index(this)"/></td>
          <td><input type="text" value="<%=tags.Count %>" class="layui-input count" onblur="Update_Index(this)"/></td>
          <td></td>
          <td><input type="checkbox" name="yyy" lay-skin="switch" lay-text="是|否" lay-filter="istop2" class="istop" <%=tags.IsTop==1?"checked":"" %>></td>
        </tr>
        <%} %>
      </tbody>
    </table>
    <div class="title">我们页菜单显示设置</div>
    <table class="layui-table">
      <colgroup>
        <col width="200">
        <col width="200">
        <col width="150">
        <col>
        <col width="130">
      </colgroup>
      <thead>
        <tr>
          <th>原始名称</th>
          <th>自定义名称</th>
          <th>显示顺序</th>
          <th></th>
          <th>是否显示</th>
        </tr> 
      </thead>
      <tbody>
        <tr column="we1">
          <td>公司环境</td>
          <td><input type="text" value="<%=we1[2] %>" class="layui-input name" onblur="Update_We(this)"/></td>
          <td><input type="text" value="<%=we1[0] %>" class="layui-input sort" onblur="Update_We(this)"/></td>
          <td></td>
          <td><input type="checkbox" name="yyy" lay-skin="switch" lay-text="是|否" lay-filter="istop3" class="istop" <%=we1[1]=="1"?"checked":"" %>></td>
        </tr>
        <tr column="we2">
          <td>资质荣誉</td>
          <td><input type="text" value="<%=we2[2] %>" class="layui-input name" onblur="Update_We(this)"/></td>
          <td><input type="text" value="<%=we2[0] %>" class="layui-input sort" onblur="Update_We(this)"/></td>
          <td></td>
          <td><input type="checkbox" name="yyy" lay-skin="switch" lay-text="是|否" lay-filter="istop3" class="istop" <%=we2[1]=="1"?"checked":"" %>></td>
        </tr>
        <tr column="we3">
          <td>公司介绍</td>
          <td><input type="text" value="<%=we3[2] %>" class="layui-input name" onblur="Update_We(this)"/></td>
          <td><input type="text" value="<%=we3[0] %>" class="layui-input sort" onblur="Update_We(this)"/></td>
          <td></td>
          <td><input type="checkbox" name="yyy" lay-skin="switch" lay-text="是|否" lay-filter="istop3" class="istop" <%=we3[1]=="1"?"checked":"" %>></td>
        </tr>
        <tr column="we4">
          <td>企业文化</td>
          <td><input type="text" value="<%=we4[2] %>" class="layui-input name" onblur="Update_We(this)"/></td>
          <td><input type="text" value="<%=we4[0] %>" class="layui-input sort" onblur="Update_We(this)"/></td>
          <td></td>
          <td><input type="checkbox" name="yyy" lay-skin="switch" lay-text="是|否" lay-filter="istop3" class="istop" <%=we4[1]=="1"?"checked":"" %>></td>
        </tr>
        <tr column="we5">
          <td>联系我们</td>
          <td><input type="text" value="<%=we5[2] %>" class="layui-input name" onblur="Update_We(this)"/></td>
          <td><input type="text" value="<%=we5[0] %>" class="layui-input sort" onblur="Update_We(this)"/></td>
          <td></td>
          <td><input type="checkbox" name="yyy" lay-skin="switch" lay-text="是|否" lay-filter="istop3" class="istop" <%=we5[1]=="1"?"checked":"" %>></td>
        </tr>
        <tr column="we6">
          <td>留言反馈</td>
          <td><input type="text" value="<%=we6[2] %>" class="layui-input name" onblur="Update_We(this)"/></td>
          <td><input type="text" value="<%=we6[0] %>" class="layui-input sort" onblur="Update_We(this)"/></td>
          <td></td>
          <td><input type="checkbox" name="yyy" lay-skin="switch" lay-text="是|否" lay-filter="istop3" class="istop" <%=we6[1]=="1"?"checked":"" %>></td>
        </tr>
        <tr column="we7">
          <td>地理位置</td>
          <td><input type="text" value="<%=we7[2] %>" class="layui-input name" onblur="Update_We(this)"/></td>
          <td><input type="text" value="<%=we7[0] %>" class="layui-input sort" onblur="Update_We(this)"/></td>
          <td></td>
          <td><input type="checkbox" name="yyy" lay-skin="switch" lay-text="是|否" lay-filter="istop3" class="istop" <%=we7[1]=="1"?"checked":"" %>></td>
        </tr>
      </tbody>
    </table>
</form>
</div>
<script>

    layui.use(["form", "table", "laydate"], function () {
        var $ = layui.jquery, form = layui.form, laydate = layui.laydate;
        table = layui.table;
        form.on('switch(istop)', function (data) {
            Update_Menu(this);
        });
        form.on('switch(istop2)', function (data) {
            Update_Index(this);
        });
        form.on('switch(istop3)', function (data) {
            Update_We(this);
        });
    });

    function Update_Menu(o) {
        var obj = $(o).parent().parent();
        var data = {};
        data.act = "Update_Menu";
        data.column = obj.attr("column");
        data.sort = obj.find(".sort").val();
        data.istop = obj.find(".istop").prop("checked") ? 1 : 0;
        data.name = obj.find(".name").val();
        data.sign = GetSign(data.act);
        if (data.name.indexOf("&") > -1) {
            LayerBox.Error("输入内容里不能包含&字符");
            return;
        }
        Ajax.Post("/tools/Admin.ashx", data, function (r) {});
    };

    function Update_Index(o) {
        var obj = $(o).parent().parent();
        var data = {};
        data.act = "Update_Index";
        data.column = obj.attr("column");
        data.sort = obj.find(".sort").val();
        data.istop = obj.find(".istop").prop("checked") ? 1 : 0;
        data.name = obj.find(".name").val();
        data.count = obj.find(".count").val();
        data.tagsid = obj.attr("tagsid");
        data.newstypeids = obj.find("#newstypeids").attr("ids");
        data.sign = GetSign(data.act);
        if (data.name.indexOf("&") > -1) {
            LayerBox.Error("输入内容里不能包含&字符");
            return;
        }
        Ajax.Post("/tools/Admin.ashx", data, function (r) { });
    };

    function Update_We(o) {
        var obj = $(o).parent().parent();
        var data = {};
        data.act = "Update_We";
        data.column = obj.attr("column");
        data.sort = obj.find(".sort").val();
        data.istop = obj.find(".istop").prop("checked") ? 1 : 0;
        data.name = obj.find(".name").val();
        data.sign = GetSign(data.act);
        if (data.name.indexOf("&") > -1) {
            LayerBox.Error("输入内容里不能包含&字符");
            return;
        }
        Ajax.Post("/tools/Admin.ashx", data, function (r) { });
    };

    function Select_NewsType() {
        Ajax.Get("/system/page/config/selectnewstype.aspx?ids=" + $("#newstypeids").attr("ids"), function (html) {
            window.parent.LayerBox.Search("选择资讯分类", html, 830, 600, function () {
                var ids = new Array();
                var names = new Array();
                window.parent.$('#layer-table input[type="checkbox"]').each(function (index, item) {
                    if (item.checked) {
                        ids.push(item.value);
                        names.push($(this).attr("val"));
                    }
                });
                if (ids.length == 0) {
                    LayerBox.Error("您至少需要选择一条资讯分类");
                    return;
                }
                $("#newstypeids").attr("ids", ids.join(",")).html(names.join(","));
                Update_Index(document.getElementById("newstypeids"));
                window.parent.LayerBox.Close.ByAll();
            });
        });
    };
</script>
</body>
</html>
